package com.ycy.ss.status;

import java.util.Date;

import com.google.api.client.auth.oauth2.Credential;

public class StatusGoogle{
	public Credential CREDENTIAL = null;

	public String LAST_ID = "";

	public Date LAST_OP_TIME;

	public String ERROR_INFO;

	public void error(String err){
		LAST_OP_TIME = new Date();
		ERROR_INFO = err;
	}

	public void ok(){
		LAST_OP_TIME = new Date();
		ERROR_INFO = "";
	}

	public void readOk(String lastId){
		ok();
		if (lastId != null) {
			if (lastId.length() > LAST_ID.length()
					|| (lastId.length() == LAST_ID.length() && lastId.compareTo(LAST_ID) > 0)) {
				LAST_ID = lastId;
			}
		}
	}

}
